﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/adminDesign.Master" AutoEventWireup="true"
    CodeBehind="RawMaterialManagement.aspx.cs" Inherits="PizzaWic.admin.RawMaterialManagement" %>

<asp:Content ID="Content1" ContentPlaceHolderID="pageTitle" runat="server">
    Matières premières
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="bodyAdmin" runat="server">
    <div id="content-table-inner">
        <div id="table-content">
            <div>
                <table id="product_table">
                    <thead>
                        <tr>
                            <th class="table-header-check">
                                Nom
                            </th>
                            <th class="table-header-repeat line-left">
                                Quantité
                            </th>
                            <th class="table-header-repeat line-left">
                                Quantité unitaire
                            </th>
                            <th class="table-header-repeat line-left">
                                Prix unitaire
                            </th>
                            <th class="table-header-repeat line-left">
                                Alerte quantité
                            </th>
                            <th class="table-header-options line-left">
                                Actions
                            </th>
                        </tr>
                    </thead>
                    <asp:Repeater ID="MonRepeater" runat="server" OnItemCommand="MonRepeater_ItemCommand">
                        <ItemTemplate>
                            <tr>
                                <td>
                                    <%# Eval("name")%>
                                </td>
                                <td class="specialTD">
                                    <asp:HiddenField ID="HiddenFieldrm" runat="server" Value='<%# Eval("id_raw_material")%>' />
                                    <asp:Label ID="quantity" runat="server" Text='<%# Eval("quantity")%>' />
                                    <asp:TextBox ID="addQuantity" style="border-radius:5px;" runat="server" Text="0" Width="50px"></asp:TextBox>
                                    <ajaxToolkit:NumericUpDownExtender ID="numericSelector" runat="server" TargetControlID="addQuantity"
                                        Width="50" Minimum="0" />
                                </td>
                                <td>
                                    <%# Eval("unitary_quantity")%>
                                </td>
                                <td>
                                    <%# Eval("price")%>
                                </td>
                                <td>
                                    <%# Eval("alert_quantity")%>
                                </td>
                                <td class="td_options">
                                    <asp:ImageButton ID="ImageButton1" runat="server" src="../images/table/action_edit.gif"
                                        title="editer" CssClass="edit" />
                                    <asp:ImageButton ID="ImageButton2" runat="server" src="../images/table/action_delete.gif"
                                        title="Supprimer" CommandName="delete_raw_material" CommandArgument='<%# Eval("id_raw_material") %>' />
                                    <ajaxToolkit:ModalPopupExtender ID="mpeEdit" runat="server" TargetControlID="ImageButton1"
                                        PopupControlID="panelEdit" CancelControlID="btnCancel" />
                                    <asp:Panel ID="panelEdit" runat="server" Width="400px" HorizontalAlign="Center">
                                        <div id='<%# Eval("id_raw_material") %>' class="overlay">
                                            <table>
                                                <thead>
                                                    <tr>
                                                        <th class="table-header-check">
                                                            Nom
                                                        </th>
                                                        <th class="table-header-repeat line-left">
                                                            Quantité
                                                        </th>
                                                        <th class="table-header-repeat line-left">
                                                            Quantité unitaire
                                                        </th>
                                                        <th class="table-header-repeat line-left">
                                                            Prix unitaire
                                                        </th>
                                                        <th class="table-header-options line-left">
                                                            Seuil d'alerte
                                                        </th>
                                                    </tr>
                                                </thead>
                                                <tr>
                                                    <td>
                                                        <asp:TextBox ID="editName" runat="server" CssClass="inp-form" Text='<%# Eval("name")%>'></asp:TextBox>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="editQuantity" runat="server" CssClass="inp-form" Text='<%# Eval("quantity")%>'></asp:TextBox>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="editUnitaryQuantity" runat="server" CssClass="inp-form" Text='<%# Eval("unitary_quantity")%>'> </asp:TextBox>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="editPrice" runat="server" CssClass="inp-form" Text='<%# Eval("price")%>'> </asp:TextBox>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="editAlertQuantity" runat="server" CssClass="inp-form" Text='<%# Eval("alert_quantity")%>'> </asp:TextBox>
                                                    </td>
                                                </tr>
                                            </table>
                                            <br></br>
                                            <br></br>
                                            <asp:Button ID="btnCancel" runat="server" Text="Annuler" />
                                            <asp:Button ID="btnEdit" runat="server" Text="Valider" CommandName="edit_raw_material"
                                                CommandArgument='<%# Eval("id_raw_material") %>' />
                                        </div>
                                        <div id="masque">
                                        </div>
                                    </asp:Panel>
                                </td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                </table>
                <asp:Button ID="addQuantityCmd" runat="server" Text="Mettre à jour les quantités" OnClick="addQuantityCmd_Click" />
            </div>
        </div>
        <div class="clear">
        </div>
    </div>
</asp:Content>
